﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.auth.entity;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.hh.bss.auth.dao.*;
import com.hh.bss.auth.entity.*;
import com.hh.bss.auth.service.*;
import com.hh.bss.auth.vo.query.*;
import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.util.*;





public class SystemResource extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "SystemResource";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_MODULE_ID = "moduleId";
	public static final String ALIAS_PARENT_ID = "parentId";
	public static final String ALIAS_RESOURCE_NBR = "resourceNbr";
	public static final String ALIAS_NAME = "name";
	public static final String ALIAS_ENTRY_URL = "entryUrl";
	public static final String ALIAS_STATUS = "status";
	public static final String ALIAS_VISIBLE = "visible";
	public static final String ALIAS_DISPLAY_LEVEL = "displayLevel";
	public static final String ALIAS_REMARK = "remark";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotNull 
	private java.lang.Integer moduleId;
	
	private java.lang.Integer parentId;
	@NotBlank @Length(max=30)
	private java.lang.String resourceNbr;
	@NotBlank @Length(max=50)
	private java.lang.String name;
	@Length(max=100)
	private java.lang.String entryUrl;
	@NotBlank @Length(max=2)
	private java.lang.String status;
	@NotNull @Max(32767)
	private Integer visible;
	@NotNull @Max(32767)
	private Integer displayLevel;
	@Length(max=255)
	private java.lang.String remark;
	//columns END

	public SystemResource(){
	}

	public SystemResource(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setModuleId(java.lang.Integer value) {
		this.moduleId = value;
	}
	
	public java.lang.Integer getModuleId() {
		return this.moduleId;
	}
	public void setParentId(java.lang.Integer value) {
		this.parentId = value;
	}
	
	public java.lang.Integer getParentId() {
		return this.parentId;
	}
	public void setResourceNbr(java.lang.String value) {
		this.resourceNbr = value;
	}
	
	public java.lang.String getResourceNbr() {
		return this.resourceNbr;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setEntryUrl(java.lang.String value) {
		this.entryUrl = value;
	}
	
	public java.lang.String getEntryUrl() {
		return this.entryUrl;
	}
	public void setStatus(java.lang.String value) {
		this.status = value;
	}
	
	public java.lang.String getStatus() {
		return this.status;
	}
	public void setVisible(Integer value) {
		this.visible = value;
	}
	
	public Integer getVisible() {
		return this.visible;
	}
	public void setDisplayLevel(Integer value) {
		this.displayLevel = value;
	}
	
	public Integer getDisplayLevel() {
		return this.displayLevel;
	}
	public void setRemark(java.lang.String value) {
		this.remark = value;
	}
	
	public java.lang.String getRemark() {
		return this.remark;
	}
	
	private Set systemRoleAcls = new HashSet(0);
	public void setSystemRoleAcls(Set systemRoleAcl){
		this.systemRoleAcls = systemRoleAcl;
	}
	
	public Set getSystemRoleAcls() {
		return systemRoleAcls;
	}
	
	private Set systemUserAcls = new HashSet(0);
	public void setSystemUserAcls(Set systemUserAcl){
		this.systemUserAcls = systemUserAcl;
	}
	
	public Set getSystemUserAcls() {
		return systemUserAcls;
	}
	
	private SystemModule systemModule;
	
	public void setSystemModule(SystemModule systemModule){
		this.systemModule = systemModule;
	}
	
	public SystemModule getSystemModule() {
		return systemModule;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("ModuleId",getModuleId())
			.append("ParentId",getParentId())
			.append("ResourceNbr",getResourceNbr())
			.append("Name",getName())
			.append("EntryUrl",getEntryUrl())
			.append("Status",getStatus())
			.append("Visible",getVisible())
			.append("DisplayLevel",getDisplayLevel())
			.append("Remark",getRemark())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SystemResource == false) return false;
		if(this == obj) return true;
		SystemResource other = (SystemResource)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

